package cn.tedu.storage.tcc;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;
import org.springframework.transaction.annotation.Transactional;

@LocalTCC
public interface StorageTccAction {

    @TwoPhaseBusinessAction(name = "StorageTccAction")
    @Transactional
    boolean prepare(BusinessActionContext ctx,
                    @BusinessActionContextParameter(paramName = "productId") Long productId,
                    @BusinessActionContextParameter(paramName = "count") Integer count);
    @Transactional
    boolean commit(BusinessActionContext ctx);
    @Transactional
    boolean rollback(BusinessActionContext ctx);

}
